//设置，改， 删除
function setCookie(cname, cvalue, exdays) {
    var d = new Date();

    d.setTime(d.getTime() + exdays*24*60*60*1000 );

    var expires = "expires="+d.toUTCString();

    document.cookie = cname+"="+cvalue+";"+expires+";path=/";

}
// getCookie("username")
function getCookie(cname) {
    //Hm_lvt_f801name=admin
    //passw77df4b25b2662225b26a02a32ab8=1577930187
    //     //userord=123456999

    var name = cname+"="; // username=
    var ca= document.cookie.split(';');
    var len = ca.length;
    for(var i=0; i<len; i++){
        //username=admin
        var c=ca[i].trim();

        if(c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }

    }

    return '';

}